qui(
	function(require, exports, module){

        Sginal.Dao = $.extend({}, Ancestor.Dao, {
            getList: function (data, callback) {
                var options = {
                    type: "post",
                    url: "/api/sginal/list",
                    dataType: "json",
                    data: data,
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                }
                Ancestor.Dao.ajax(options, "/sginal/list");
            },
            getStatusList: function (data, callback) {
                var options = {
                    type: "post",
                    url: "/api/sginal/status/list",
                    dataType: "json",
                    data: data,
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                }
                Ancestor.Dao.ajax(options, "/sginal/list");
            },
            add: function (data, callback) {
                var options = {
                    type: "post",
                    url: "/api/sginal/create",
                    dataType: "json",
                    data: data,
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                }
                Ancestor.Dao.ajax(options, "/sginal/create");
            },
            edit: function (data, callback) {
                var options = {
                    type: "post",
                    url: "/api/sginal/edit",
                    dataType: "json",
                    data: data,
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                }
                Ancestor.Dao.ajax(options, "/sginal/edit");
            },
            delete: function (data, callback) {
                var options = {
                    type: "post",
                    url: "/api/sginal/delete",
                    dataType: "json",
                    data: data,
                    forceDel: function(rdata){
                        if(rdata.code!="A00000"){
                            SystemDialog.queryConfirm("删除失败，是否要强制删除？", function (flag) {
                                if (flag == true) {
                                    Sginal.Dao.forceDel(data, function () {
                                        $('.query-btn').click();
                                    });
                                }
                            });
                        }
                    },
                    success: function (rdata) {
                        callback.call(this, rdata);
                        this.forceDel(rdata);

                    },
                    error: function (rdata) {
                        callback.call(this, rdata);
                        this.forceDel(rdata);
                    }
                }
                Ancestor.Dao.ajax(options, "/sginal/delete");
            },
            forceDel: function(data, callback){
                var options = {
                    type: "post",
                    url: "/api/sginal/forceDel",
                    dataType: "json",
                    data: data,
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                }
                Ancestor.Dao.ajax(options, "/sginal/forceDel");
            },
            start: function (data, callback) {
                var options = {
                    type: "post",
                    url: "/api/sginal/start",
                    dataType: "json",
                    data: data,
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                }
                Ancestor.Dao.ajax(options, "/sginal/start");
            },
            stop: function (data, callback) {
                var options = {
                    type: "post",
                    url: "/api/sginal/stop",
                    dataType: "json",
                    data: data,
                    success: function (data) {
                        callback.call(this, data);
                    },
                    error: function (data) {
                        callback.call(this, data);
                    }
                }
                Ancestor.Dao.ajax(options, "/sginal/stop");
            },
            redirect: function(data, callback) {
                var options = {
                    url: '/api/redirect',
                    dataType: 'json',
                    data: data,
                    method: 'post',
                    success: function(data) {
                        callback.call(this, data);
                    },
                    error: function(data) {
                        callback.call(this, data);
                    }
                };
                Ancestor.Dao.ajax(options,'/redirect');
            }

        });
	}
);